package com.singing.manager;

import com.singing.model.Command;

import java.util.ArrayList;
import java.util.List;

// 应用程序管理类
public class ApplicationManager extends BaseManager {
    // 管理员登陆
    private static final int ADMIN_LOGIN = 1;

    // 管理员注册
    private static final int ADMIN_REGISTER = 2;

    // 歌手管理
    private static final int SINGER_MANAGER = 3;

    // 评委管理
    private static final int JUDGES_MANAGER = 4;

    // 成绩管理
    private static final int SCORE_MANAGER = 5;

    public ApplicationManager(String title, List<Command> commandList) {
        super(title, commandList);
    }

    @Override
    protected int processCommand(int command) {
        switch (command) {
            case ADMIN_LOGIN:
                ArrayList<Command> list = new ArrayList<>();
                list.add(new Command(1, "输入用户名密码", false));
                new AdminLoginManager("管理员登陆", list).manage();
                break;
            case ADMIN_REGISTER:
                ArrayList<Command> registCommandList = new ArrayList<>();
                registCommandList.add(new Command(1, "输入注册信息", false));
                new AdminRegistManager("管理员注册", registCommandList).manage();
                break;
            case SINGER_MANAGER:
                ArrayList<Command> singerCommandList = new ArrayList<>();
                singerCommandList.add(new Command(1, "歌手列表"));
                singerCommandList.add(new Command(2, "歌手新增"));
                singerCommandList.add(new Command(3, "歌手修改"));
                singerCommandList.add(new Command(4, "歌手删除"));

                new SingerManager("歌手管理", singerCommandList).manage();
                break;
            case JUDGES_MANAGER:
                ArrayList<Command> judgesCommandList = new ArrayList<>();
                judgesCommandList.add(new Command(1, "裁判列表"));
                judgesCommandList.add(new Command(2, "裁判新增"));
                judgesCommandList.add(new Command(3, "裁判修改"));
                judgesCommandList.add(new Command(4, "裁判删除"));

                new JudgesManager("裁判管理", judgesCommandList).manage();
                break;
            case SCORE_MANAGER:
                ArrayList<Command> singScoreCommandList = new ArrayList<>();
                singScoreCommandList.add(new Command(2, "为选手评分"));
                singScoreCommandList.add(new Command(3, "查询单个歌手评分"));
                singScoreCommandList.add(new Command(4, "查询所有歌手评分"));

                new SingScoreManager("比赛评分管理", singScoreCommandList).manage();
        }
        return 0;
    }
}
